3.5.52 \(\int (a+b \sec ^3(e+f x)) \tan ^5(e+f x) \, dx\) [452]

Optimal. Leaf size=92 \[ -\frac {a \log (\cos (e+f x))}{f}-\frac {a \sec ^2(e+f x)}{f}+\frac {b \sec ^3(e+f x)}{3 f}+\frac {a \sec ^4(e+f x)}{4 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f} \]

[Out]

-a*ln(cos(f*x+e))/f-a*sec(f*x+e)^2/f+1/3*b*sec(f*x+e)^3/f+1/4*a*sec(f*x+e)^4/f-2/5*b*sec(f*x+e)^5/f+1/7*b*sec(
f*x+e)^7/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4223, 1816} \begin {gather*} \frac {a \sec ^4(e+f x)}{4 f}-\frac {a \sec ^2(e+f x)}{f}-\frac {a \log (\cos (e+f x))}{f}+\frac {b \sec ^7(e+f x)}{7 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^3(e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^3)*Tan[e + f*x]^5,x]

[Out]

-((a*Log[Cos[e + f*x]])/f) - (a*Sec[e + f*x]^2)/f + (b*Sec[e + f*x]^3)/(3*f) + (a*Sec[e + f*x]^4)/(4*f) - (2*b
*Sec[e + f*x]^5)/(5*f) + (b*Sec[e + f*x]^7)/(7*f)

Rule 1816

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 4223

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, Dist[-(f*ff^(m + n*p - 1))^(-1), Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*
(ff*x)^n)^p/x^(m + n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \sec ^3(e+f x)\right ) \tan ^5(e+f x) \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (1-x^2\right )^2 \left (b+a x^3\right )}{x^8} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {b}{x^8}-\frac {2 b}{x^6}+\frac {a}{x^5}+\frac {b}{x^4}-\frac {2 a}{x^3}+\frac {a}{x}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {a \log (\cos (e+f x))}{f}-\frac {a \sec ^2(e+f x)}{f}+\frac {b \sec ^3(e+f x)}{3 f}+\frac {a \sec ^4(e+f x)}{4 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.30, size = 87, normalized size = 0.95 \begin {gather*} \frac {b \sec ^3(e+f x)}{3 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f}-\frac {a \left (4 \log (\cos (e+f x))+2 \tan ^2(e+f x)-\tan ^4(e+f x)\right )}{4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^3)*Tan[e + f*x]^5,x]

[Out]

(b*Sec[e + f*x]^3)/(3*f) - (2*b*Sec[e + f*x]^5)/(5*f) + (b*Sec[e + f*x]^7)/(7*f) - (a*(4*Log[Cos[e + f*x]] + 2
*Tan[e + f*x]^2 - Tan[e + f*x]^4))/(4*f)

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 141, normalized size = 1.53

method result size
derivativedivides \(\frac {a \left (\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\cos \left (f x +e \right )\right )\right )+b \left (\frac {\sin ^{6}\left (f x +e \right )}{7 \cos \left (f x +e \right )^{7}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )^{5}}-\frac {\sin ^{6}\left (f x +e \right )}{105 \cos \left (f x +e \right )^{3}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{35}\right )}{f}\) \(141\)
default \(\frac {a \left (\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\cos \left (f x +e \right )\right )\right )+b \left (\frac {\sin ^{6}\left (f x +e \right )}{7 \cos \left (f x +e \right )^{7}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )^{5}}-\frac {\sin ^{6}\left (f x +e \right )}{105 \cos \left (f x +e \right )^{3}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{35}\right )}{f}\) \(141\)
risch \(i a x +\frac {2 i a e}{f}-\frac {4 \left (105 a \,{\mathrm e}^{12 i \left (f x +e \right )}-70 b \,{\mathrm e}^{11 i \left (f x +e \right )}+420 a \,{\mathrm e}^{10 i \left (f x +e \right )}+56 b \,{\mathrm e}^{9 i \left (f x +e \right )}+735 a \,{\mathrm e}^{8 i \left (f x +e \right )}-228 b \,{\mathrm e}^{7 i \left (f x +e \right )}+735 a \,{\mathrm e}^{6 i \left (f x +e \right )}+56 b \,{\mathrm e}^{5 i \left (f x +e \right )}+420 a \,{\mathrm e}^{4 i \left (f x +e \right )}-70 b \,{\mathrm e}^{3 i \left (f x +e \right )}+105 a \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{105 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{7}}-\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{f}\) \(184\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^3)*tan(f*x+e)^5,x,method=_RETURNVERBOSE)

[Out]

1/f*(a*(1/4*tan(f*x+e)^4-1/2*tan(f*x+e)^2-ln(cos(f*x+e)))+b*(1/7*sin(f*x+e)^6/cos(f*x+e)^7+1/35*sin(f*x+e)^6/c
os(f*x+e)^5-1/105*sin(f*x+e)^6/cos(f*x+e)^3+1/35*sin(f*x+e)^6/cos(f*x+e)+1/35*(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)
^2)*cos(f*x+e)))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 79, normalized size = 0.86 \begin {gather*} -\frac {420 \, a \log \left (\cos \left (f x + e\right )\right ) + \frac {420 \, a \cos \left (f x + e\right )^{5} - 140 \, b \cos \left (f x + e\right )^{4} - 105 \, a \cos \left (f x + e\right )^{3} + 168 \, b \cos \left (f x + e\right )^{2} - 60 \, b}{\cos \left (f x + e\right )^{7}}}{420 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^5,x, algorithm="maxima")

[Out]

-1/420*(420*a*log(cos(f*x + e)) + (420*a*cos(f*x + e)^5 - 140*b*cos(f*x + e)^4 - 105*a*cos(f*x + e)^3 + 168*b*
cos(f*x + e)^2 - 60*b)/cos(f*x + e)^7)/f

________________________________________________________________________________________

Fricas [A]
time = 2.56, size = 88, normalized size = 0.96 \begin {gather*} -\frac {420 \, a \cos \left (f x + e\right )^{7} \log \left (-\cos \left (f x + e\right )\right ) + 420 \, a \cos \left (f x + e\right )^{5} - 140 \, b \cos \left (f x + e\right )^{4} - 105 \, a \cos \left (f x + e\right )^{3} + 168 \, b \cos \left (f x + e\right )^{2} - 60 \, b}{420 \, f \cos \left (f x + e\right )^{7}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^5,x, algorithm="fricas")

[Out]

-1/420*(420*a*cos(f*x + e)^7*log(-cos(f*x + e)) + 420*a*cos(f*x + e)^5 - 140*b*cos(f*x + e)^4 - 105*a*cos(f*x
+ e)^3 + 168*b*cos(f*x + e)^2 - 60*b)/(f*cos(f*x + e)^7)

________________________________________________________________________________________

Sympy [A]
time = 1.14, size = 119, normalized size = 1.29 \begin {gather*} \begin {cases} \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {a \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {b \tan ^{4}{\left (e + f x \right )} \sec ^{3}{\left (e + f x \right )}}{7 f} - \frac {4 b \tan ^{2}{\left (e + f x \right )} \sec ^{3}{\left (e + f x \right )}}{35 f} + \frac {8 b \sec ^{3}{\left (e + f x \right )}}{105 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{3}{\left (e \right )}\right ) \tan ^{5}{\left (e \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**3)*tan(f*x+e)**5,x)

[Out]

Piecewise((a*log(tan(e + f*x)**2 + 1)/(2*f) + a*tan(e + f*x)**4/(4*f) - a*tan(e + f*x)**2/(2*f) + b*tan(e + f*
x)**4*sec(e + f*x)**3/(7*f) - 4*b*tan(e + f*x)**2*sec(e + f*x)**3/(35*f) + 8*b*sec(e + f*x)**3/(105*f), Ne(f,
0)), (x*(a + b*sec(e)**3)*tan(e)**5, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 340 vs. \(2 (84) = 168\).
time = 1.83, size = 340, normalized size = 3.70 \begin {gather*} \frac {420 \, a \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right ) - 420 \, a \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 1 \right |}\right ) + \frac {1089 \, a + 64 \, b + \frac {8463 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {448 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {28749 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {1344 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {51555 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {2240 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {51555 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {4480 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {28749 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {8463 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + \frac {1089 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}}}{{\left (\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{7}}}{420 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^3)*tan(f*x+e)^5,x, algorithm="giac")

[Out]

1/420*(420*a*log(abs(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)) - 420*a*log(abs(-(cos(f*x + e) - 1)/(cos(f*x
 + e) + 1) - 1)) + (1089*a + 64*b + 8463*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 448*b*(cos(f*x + e) - 1)/(c
os(f*x + e) + 1) + 28749*a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 1344*b*(cos(f*x + e) - 1)^2/(cos(f*x +
e) + 1)^2 + 51555*a*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 - 2240*b*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)
^3 + 51555*a*(cos(f*x + e) - 1)^4/(cos(f*x + e) + 1)^4 + 4480*b*(cos(f*x + e) - 1)^4/(cos(f*x + e) + 1)^4 + 28
749*a*(cos(f*x + e) - 1)^5/(cos(f*x + e) + 1)^5 + 8463*a*(cos(f*x + e) - 1)^6/(cos(f*x + e) + 1)^6 + 1089*a*(c
os(f*x + e) - 1)^7/(cos(f*x + e) + 1)^7)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)^7)/f

________________________________________________________________________________________

Mupad [B]
time = 8.79, size = 227, normalized size = 2.47 \begin {gather*} \frac {2\,a\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}{f}-\frac {2\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}-14\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}+\left (32\,a+\frac {32\,b}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+\left (\frac {16\,b}{3}-32\,a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+\left (14\,a+\frac {16\,b}{5}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (-2\,a-\frac {16\,b}{15}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\frac {16\,b}{105}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{14}-7\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}-35\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-21\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+7\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^5*(a + b/cos(e + f*x)^3),x)

[Out]

(2*a*atanh(tan(e/2 + (f*x)/2)^2))/f - ((16*b)/105 - tan(e/2 + (f*x)/2)^2*(2*a + (16*b)/15) + tan(e/2 + (f*x)/2
)^4*(14*a + (16*b)/5) - tan(e/2 + (f*x)/2)^6*(32*a - (16*b)/3) + tan(e/2 + (f*x)/2)^8*(32*a + (32*b)/3) - 14*a
*tan(e/2 + (f*x)/2)^10 + 2*a*tan(e/2 + (f*x)/2)^12)/(f*(7*tan(e/2 + (f*x)/2)^2 - 21*tan(e/2 + (f*x)/2)^4 + 35*
tan(e/2 + (f*x)/2)^6 - 35*tan(e/2 + (f*x)/2)^8 + 21*tan(e/2 + (f*x)/2)^10 - 7*tan(e/2 + (f*x)/2)^12 + tan(e/2
+ (f*x)/2)^14 - 1))

________________________________________________________________________________________